<?

if (!$user)
{
  include "page_personal_logon.php";
  return;
}

$PageTitle=$msg["Page_MyProfile"];

include "div_menu_personal.php";

?>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
  <td valign="top" width="100%">
    <?print_user_info($user);?>
  </td>

  <td valign="top" align="center">
    <?show_image($user["image"]);?>
  </td>
</tr>
</table>


<a href="personal_change_profile"><?=$msg["ChangeProfile"];?></a><br>
<a href="personal_change_password"><?=$msg["ChangePassword"];?></a><br>
<a href="personal_change_picture"><?=$msg["ChangeUserPicture"];?></a><br>
<br>
<a href="personal_delete_profile"><?=$msg["DeleteProfile"];?></a><br>

<?
function show_image($id)
{
  global $msg;

  if ($id)
  {
    $size = db_read_rec( sprintf("SELECT width, height FROM images WHERE id=%d", $id) );
    $maxheight = ($size["height"] > 300) ? 300 : $size["height"];

    print "<b>{$msg["Picture"]}<b><br>\n";
    print "<img src=\"getimage?id=$id\" height=$maxheight>\n";
  }
}

?>
